﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using APP.HELPER;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Common;

    public class xucTimekeeperFormula : Common.xucBase
    {
        private CalcEdit calMaximumMinuteHoliday;
        private CalcEdit calMaximumMinuteSaturday;
        private CalcEdit calMaximumMinuteSunday;
        private CalcEdit calMinimumMinuteHoliday;
        private CalcEdit calMinimumMinuteSaturday;
        private CalcEdit calMinimumMinuteSunday;
        private CalcEdit calNumberDayStandard;
        private CalcEdit calNumberHourStandard;
        private ComboBoxEdit cboOvertimeHolidayType;
        private ComboBoxEdit cboOvertimeSaturdayType;
        private ComboBoxEdit cboOvertimeSundayType;
        private CheckEdit cheIsOvertimeHoliday;
        private CheckEdit cheIsOvertimeSaturday;
        private CheckEdit cheIsOvertimeSunday;
        private IContainer components = null;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private GroupBox groupBox3;
        private LabelControl labelControl1;
        private LabelControl labelControl10;
        private LabelControl labelControl11;
        private LabelControl labelControl12;
        private LabelControl labelControl13;
        private LabelControl labelControl14;
        private LabelControl labelControl15;
        private LabelControl labelControl16;
        private LabelControl labelControl17;
        private LabelControl labelControl18;
        private LabelControl labelControl19;
        private LabelControl labelControl2;
        private LabelControl labelControl21;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;
        private LabelControl labelControl6;
        private LabelControl labelControl7;
        private LabelControl labelControl8;
        private LabelControl labelControl9;
        private Panel pnOvertimeHoliday;
        private Panel pnOvertimeSaturday;
        private Panel pnOvertimeSunday;
        private Panel pnSubOvertimeHoliday;
        private Panel pnSubOvertimeSaturday;
        private Panel pnSubOvertimeSunday;
        private TimeEdit teBeginTimeHoliday;
        private TimeEdit teBeginTimeNight;
        private TimeEdit teBeginTimeSaturday;
        private TimeEdit teBeginTimeSunday;
        private TimeEdit teEndTimeNight;

        public xucTimekeeperFormula()
        {
            this.InitializeComponent();
            this.Init();
        }

        private void cboOvertimeHolidayType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cboOvertimeHolidayType.SelectedIndex == 0)
            {
                this.pnSubOvertimeHoliday.Enabled = false;
            }
            else
            {
                this.pnSubOvertimeHoliday.Enabled = true;
            }
        }

        private void cboOvertimeSaturdayType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cboOvertimeSaturdayType.SelectedIndex == 0)
            {
                this.pnSubOvertimeSaturday.Enabled = false;
            }
            else
            {
                this.pnSubOvertimeSaturday.Enabled = true;
            }
        }

        private void cboOvertimeSundayType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cboOvertimeSundayType.SelectedIndex == 0)
            {
                this.pnSubOvertimeSunday.Enabled = false;
            }
            else
            {
                this.pnSubOvertimeSunday.Enabled = true;
            }
        }

        private void cheIsOvertimeHoliday_CheckedChanged(object sender, EventArgs e)
        {
            if (this.cheIsOvertimeHoliday.Checked)
            {
                this.pnOvertimeHoliday.Enabled = true;
            }
            else
            {
                this.pnOvertimeHoliday.Enabled = false;
            }
        }

        private void cheIsOvertimeSaturday_CheckedChanged(object sender, EventArgs e)
        {
            if (this.cheIsOvertimeSaturday.Checked)
            {
                this.pnOvertimeSaturday.Enabled = true;
            }
            else
            {
                this.pnOvertimeSaturday.Enabled = false;
            }
        }

        private void cheIsOvertimeSunday_CheckedChanged(object sender, EventArgs e)
        {
            if (this.cheIsOvertimeSunday.Checked)
            {
                this.pnOvertimeSunday.Enabled = true;
            }
            else
            {
                this.pnOvertimeSunday.Enabled = false;
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Init()
        {
            DIC_TIMEKEEPER_FORMULA dic_timekeeper_formula = new DIC_TIMEKEEPER_FORMULA();
            dic_timekeeper_formula.Get();
            this.cheIsOvertimeSaturday.Checked = dic_timekeeper_formula.IsOvertimeSaturday;
            this.cboOvertimeSaturdayType.SelectedIndex = dic_timekeeper_formula.OvertimeSaturdayType;
            this.teBeginTimeSaturday.EditValue = dic_timekeeper_formula.BeginTimeSaturday;
            this.calMinimumMinuteSaturday.EditValue = dic_timekeeper_formula.MinimumMinuteSaturday;
            this.calMaximumMinuteSaturday.EditValue = dic_timekeeper_formula.MaximumMinuteSaturday;
            this.cheIsOvertimeSunday.Checked = dic_timekeeper_formula.IsOvertimeSunday;
            this.cboOvertimeSundayType.SelectedIndex = dic_timekeeper_formula.OvertimeSundayType;
            this.teBeginTimeSunday.EditValue = dic_timekeeper_formula.BeginTimeSunday;
            this.calMinimumMinuteSunday.EditValue = dic_timekeeper_formula.MinimumMinuteSunday;
            this.calMaximumMinuteSunday.EditValue = dic_timekeeper_formula.MaximumMinuteSunday;
            this.cheIsOvertimeHoliday.Checked = dic_timekeeper_formula.IsOvertimeHoliday;
            this.cboOvertimeHolidayType.SelectedIndex = dic_timekeeper_formula.OvertimeHolidayType;
            this.teBeginTimeHoliday.EditValue = dic_timekeeper_formula.BeginTimeHoliday;
            this.calMinimumMinuteHoliday.EditValue = dic_timekeeper_formula.MinimumMinuteHoliday;
            this.calMaximumMinuteHoliday.EditValue = dic_timekeeper_formula.MaximumMinuteHoliday;
            this.teBeginTimeNight.EditValue = dic_timekeeper_formula.BeginTimeNight;
            this.teEndTimeNight.EditValue = dic_timekeeper_formula.EndTimeNight;
            this.calNumberDayStandard.EditValue = dic_timekeeper_formula.NumberDayStandard;
            this.calNumberHourStandard.EditValue = dic_timekeeper_formula.NumberHourStandard;
        }

        private void InitializeComponent()
        {
            this.cheIsOvertimeSunday = new DevExpress.XtraEditors.CheckEdit();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.pnOvertimeHoliday = new System.Windows.Forms.Panel();
            this.labelControl15 = new DevExpress.XtraEditors.LabelControl();
            this.cboOvertimeHolidayType = new DevExpress.XtraEditors.ComboBoxEdit();
            this.pnSubOvertimeHoliday = new System.Windows.Forms.Panel();
            this.labelControl11 = new DevExpress.XtraEditors.LabelControl();
            this.calMaximumMinuteHoliday = new DevExpress.XtraEditors.CalcEdit();
            this.labelControl12 = new DevExpress.XtraEditors.LabelControl();
            this.teBeginTimeHoliday = new DevExpress.XtraEditors.TimeEdit();
            this.calMinimumMinuteHoliday = new DevExpress.XtraEditors.CalcEdit();
            this.labelControl10 = new DevExpress.XtraEditors.LabelControl();
            this.pnOvertimeSunday = new System.Windows.Forms.Panel();
            this.labelControl14 = new DevExpress.XtraEditors.LabelControl();
            this.cboOvertimeSundayType = new DevExpress.XtraEditors.ComboBoxEdit();
            this.pnSubOvertimeSunday = new System.Windows.Forms.Panel();
            this.labelControl9 = new DevExpress.XtraEditors.LabelControl();
            this.calMaximumMinuteSunday = new DevExpress.XtraEditors.CalcEdit();
            this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
            this.teBeginTimeSunday = new DevExpress.XtraEditors.TimeEdit();
            this.labelControl4 = new DevExpress.XtraEditors.LabelControl();
            this.calMinimumMinuteSunday = new DevExpress.XtraEditors.CalcEdit();
            this.pnOvertimeSaturday = new System.Windows.Forms.Panel();
            this.labelControl13 = new DevExpress.XtraEditors.LabelControl();
            this.cboOvertimeSaturdayType = new DevExpress.XtraEditors.ComboBoxEdit();
            this.pnSubOvertimeSaturday = new System.Windows.Forms.Panel();
            this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
            this.calMaximumMinuteSaturday = new DevExpress.XtraEditors.CalcEdit();
            this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
            this.teBeginTimeSaturday = new DevExpress.XtraEditors.TimeEdit();
            this.calMinimumMinuteSaturday = new DevExpress.XtraEditors.CalcEdit();
            this.labelControl8 = new DevExpress.XtraEditors.LabelControl();
            this.cheIsOvertimeHoliday = new DevExpress.XtraEditors.CheckEdit();
            this.cheIsOvertimeSaturday = new DevExpress.XtraEditors.CheckEdit();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.labelControl7 = new DevExpress.XtraEditors.LabelControl();
            this.teEndTimeNight = new DevExpress.XtraEditors.TimeEdit();
            this.labelControl6 = new DevExpress.XtraEditors.LabelControl();
            this.teBeginTimeNight = new DevExpress.XtraEditors.TimeEdit();
            this.labelControl5 = new DevExpress.XtraEditors.LabelControl();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.labelControl21 = new DevExpress.XtraEditors.LabelControl();
            this.labelControl19 = new DevExpress.XtraEditors.LabelControl();
            this.labelControl18 = new DevExpress.XtraEditors.LabelControl();
            this.labelControl17 = new DevExpress.XtraEditors.LabelControl();
            this.labelControl16 = new DevExpress.XtraEditors.LabelControl();
            this.calNumberHourStandard = new DevExpress.XtraEditors.CalcEdit();
            this.calNumberDayStandard = new DevExpress.XtraEditors.CalcEdit();
            ((System.ComponentModel.ISupportInitialize)(this.cheIsOvertimeSunday.Properties)).BeginInit();
            this.groupBox1.SuspendLayout();
            this.pnOvertimeHoliday.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cboOvertimeHolidayType.Properties)).BeginInit();
            this.pnSubOvertimeHoliday.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calMaximumMinuteHoliday.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.teBeginTimeHoliday.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.calMinimumMinuteHoliday.Properties)).BeginInit();
            this.pnOvertimeSunday.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cboOvertimeSundayType.Properties)).BeginInit();
            this.pnSubOvertimeSunday.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calMaximumMinuteSunday.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.teBeginTimeSunday.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.calMinimumMinuteSunday.Properties)).BeginInit();
            this.pnOvertimeSaturday.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cboOvertimeSaturdayType.Properties)).BeginInit();
            this.pnSubOvertimeSaturday.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calMaximumMinuteSaturday.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.teBeginTimeSaturday.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.calMinimumMinuteSaturday.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.cheIsOvertimeHoliday.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.cheIsOvertimeSaturday.Properties)).BeginInit();
            this.groupBox2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.teEndTimeNight.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.teBeginTimeNight.Properties)).BeginInit();
            this.groupBox3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calNumberHourStandard.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.calNumberDayStandard.Properties)).BeginInit();
            this.SuspendLayout();
            // 
            // cheIsOvertimeSunday
            // 
            this.cheIsOvertimeSunday.Location = new System.Drawing.Point(14, 130);
            this.cheIsOvertimeSunday.Name = "cheIsOvertimeSunday";
            this.cheIsOvertimeSunday.Properties.Caption = "Đi làm chủ nhật tính là tăng ca";
            this.cheIsOvertimeSunday.Size = new System.Drawing.Size(180, 19);
            this.cheIsOvertimeSunday.TabIndex = 0;
            this.cheIsOvertimeSunday.CheckedChanged += new System.EventHandler(this.cheIsOvertimeSunday_CheckedChanged);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.pnOvertimeHoliday);
            this.groupBox1.Controls.Add(this.pnOvertimeSunday);
            this.groupBox1.Controls.Add(this.pnOvertimeSaturday);
            this.groupBox1.Controls.Add(this.cheIsOvertimeHoliday);
            this.groupBox1.Controls.Add(this.cheIsOvertimeSaturday);
            this.groupBox1.Controls.Add(this.cheIsOvertimeSunday);
            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox1.Location = new System.Drawing.Point(0, 0);
            this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(528, 341);
            this.groupBox1.TabIndex = 1;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Tăng ca";
            // 
            // pnOvertimeHoliday
            // 
            this.pnOvertimeHoliday.Controls.Add(this.labelControl15);
            this.pnOvertimeHoliday.Controls.Add(this.cboOvertimeHolidayType);
            this.pnOvertimeHoliday.Controls.Add(this.pnSubOvertimeHoliday);
            this.pnOvertimeHoliday.Location = new System.Drawing.Point(8, 259);
            this.pnOvertimeHoliday.Name = "pnOvertimeHoliday";
            this.pnOvertimeHoliday.Size = new System.Drawing.Size(456, 66);
            this.pnOvertimeHoliday.TabIndex = 29;
            // 
            // labelControl15
            // 
            this.labelControl15.AllowHtmlString = true;
            this.labelControl15.Location = new System.Drawing.Point(11, 7);
            this.labelControl15.Name = "labelControl15";
            this.labelControl15.Size = new System.Drawing.Size(81, 13);
            this.labelControl15.TabIndex = 23;
            this.labelControl15.Text = "Hình thức duyệt:";
            // 
            // cboOvertimeHolidayType
            // 
            this.cboOvertimeHolidayType.Location = new System.Drawing.Point(100, 4);
            this.cboOvertimeHolidayType.Name = "cboOvertimeHolidayType";
            this.cboOvertimeHolidayType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.cboOvertimeHolidayType.Properties.Items.AddRange(new object[] {
            "Không quy định cụ thể thời gian tăng ca",
            "Tuân theo quy định bên dưới"});
            this.cboOvertimeHolidayType.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            this.cboOvertimeHolidayType.Size = new System.Drawing.Size(344, 20);
            this.cboOvertimeHolidayType.TabIndex = 22;
            this.cboOvertimeHolidayType.SelectedIndexChanged += new System.EventHandler(this.cboOvertimeHolidayType_SelectedIndexChanged);
            // 
            // pnSubOvertimeHoliday
            // 
            this.pnSubOvertimeHoliday.Controls.Add(this.labelControl11);
            this.pnSubOvertimeHoliday.Controls.Add(this.calMaximumMinuteHoliday);
            this.pnSubOvertimeHoliday.Controls.Add(this.labelControl12);
            this.pnSubOvertimeHoliday.Controls.Add(this.teBeginTimeHoliday);
            this.pnSubOvertimeHoliday.Controls.Add(this.calMinimumMinuteHoliday);
            this.pnSubOvertimeHoliday.Controls.Add(this.labelControl10);
            this.pnSubOvertimeHoliday.Location = new System.Drawing.Point(7, 30);
            this.pnSubOvertimeHoliday.Name = "pnSubOvertimeHoliday";
            this.pnSubOvertimeHoliday.Size = new System.Drawing.Size(439, 29);
            this.pnSubOvertimeHoliday.TabIndex = 26;
            // 
            // labelControl11
            // 
            this.labelControl11.AllowHtmlString = true;
            this.labelControl11.Location = new System.Drawing.Point(4, 7);
            this.labelControl11.Name = "labelControl11";
            this.labelControl11.Size = new System.Drawing.Size(55, 13);
            this.labelControl11.TabIndex = 19;
            this.labelControl11.Text = "Giờ bắt đầu";
            // 
            // calMaximumMinuteHoliday
            // 
            this.calMaximumMinuteHoliday.Location = new System.Drawing.Point(389, 4);
            this.calMaximumMinuteHoliday.Name = "calMaximumMinuteHoliday";
            this.calMaximumMinuteHoliday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calMaximumMinuteHoliday.Size = new System.Drawing.Size(50, 20);
            this.calMaximumMinuteHoliday.TabIndex = 16;
            // 
            // labelControl12
            // 
            this.labelControl12.Location = new System.Drawing.Point(317, 7);
            this.labelControl12.Name = "labelControl12";
            this.labelControl12.Size = new System.Drawing.Size(67, 13);
            this.labelControl12.TabIndex = 17;
            this.labelControl12.Text = "Số phút tối đa";
            // 
            // teBeginTimeHoliday
            // 
            this.teBeginTimeHoliday.EditValue = new System.DateTime(2011, 7, 30, 0, 0, 0, 0);
            this.teBeginTimeHoliday.Location = new System.Drawing.Point(69, 4);
            this.teBeginTimeHoliday.Name = "teBeginTimeHoliday";
            this.teBeginTimeHoliday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.teBeginTimeHoliday.Properties.Mask.EditMask = "HH:mm tt";
            this.teBeginTimeHoliday.Size = new System.Drawing.Size(70, 20);
            this.teBeginTimeHoliday.TabIndex = 18;
            // 
            // calMinimumMinuteHoliday
            // 
            this.calMinimumMinuteHoliday.Location = new System.Drawing.Point(246, 4);
            this.calMinimumMinuteHoliday.Name = "calMinimumMinuteHoliday";
            this.calMinimumMinuteHoliday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calMinimumMinuteHoliday.Size = new System.Drawing.Size(50, 20);
            this.calMinimumMinuteHoliday.TabIndex = 20;
            // 
            // labelControl10
            // 
            this.labelControl10.Location = new System.Drawing.Point(162, 7);
            this.labelControl10.Name = "labelControl10";
            this.labelControl10.Size = new System.Drawing.Size(79, 13);
            this.labelControl10.TabIndex = 21;
            this.labelControl10.Text = "Số phút tối thiểu";
            // 
            // pnOvertimeSunday
            // 
            this.pnOvertimeSunday.Controls.Add(this.labelControl14);
            this.pnOvertimeSunday.Controls.Add(this.cboOvertimeSundayType);
            this.pnOvertimeSunday.Controls.Add(this.pnSubOvertimeSunday);
            this.pnOvertimeSunday.Location = new System.Drawing.Point(8, 158);
            this.pnOvertimeSunday.Name = "pnOvertimeSunday";
            this.pnOvertimeSunday.Size = new System.Drawing.Size(456, 62);
            this.pnOvertimeSunday.TabIndex = 28;
            // 
            // labelControl14
            // 
            this.labelControl14.AllowHtmlString = true;
            this.labelControl14.Location = new System.Drawing.Point(12, 3);
            this.labelControl14.Name = "labelControl14";
            this.labelControl14.Size = new System.Drawing.Size(81, 13);
            this.labelControl14.TabIndex = 23;
            this.labelControl14.Text = "Hình thức duyệt:";
            // 
            // cboOvertimeSundayType
            // 
            this.cboOvertimeSundayType.Location = new System.Drawing.Point(101, 0);
            this.cboOvertimeSundayType.Name = "cboOvertimeSundayType";
            this.cboOvertimeSundayType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.cboOvertimeSundayType.Properties.Items.AddRange(new object[] {
            "Không quy định cụ thể thời gian tăng ca",
            "Tuân theo quy định bên dưới"});
            this.cboOvertimeSundayType.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            this.cboOvertimeSundayType.Size = new System.Drawing.Size(344, 20);
            this.cboOvertimeSundayType.TabIndex = 22;
            this.cboOvertimeSundayType.SelectedIndexChanged += new System.EventHandler(this.cboOvertimeSundayType_SelectedIndexChanged);
            // 
            // pnSubOvertimeSunday
            // 
            this.pnSubOvertimeSunday.Controls.Add(this.labelControl9);
            this.pnSubOvertimeSunday.Controls.Add(this.calMaximumMinuteSunday);
            this.pnSubOvertimeSunday.Controls.Add(this.labelControl2);
            this.pnSubOvertimeSunday.Controls.Add(this.teBeginTimeSunday);
            this.pnSubOvertimeSunday.Controls.Add(this.labelControl4);
            this.pnSubOvertimeSunday.Controls.Add(this.calMinimumMinuteSunday);
            this.pnSubOvertimeSunday.Location = new System.Drawing.Point(8, 29);
            this.pnSubOvertimeSunday.Name = "pnSubOvertimeSunday";
            this.pnSubOvertimeSunday.Size = new System.Drawing.Size(439, 29);
            this.pnSubOvertimeSunday.TabIndex = 25;
            // 
            // labelControl9
            // 
            this.labelControl9.Location = new System.Drawing.Point(161, 7);
            this.labelControl9.Name = "labelControl9";
            this.labelControl9.Size = new System.Drawing.Size(79, 13);
            this.labelControl9.TabIndex = 14;
            this.labelControl9.Text = "Số phút tối thiểu";
            // 
            // calMaximumMinuteSunday
            // 
            this.calMaximumMinuteSunday.Location = new System.Drawing.Point(388, 4);
            this.calMaximumMinuteSunday.Name = "calMaximumMinuteSunday";
            this.calMaximumMinuteSunday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calMaximumMinuteSunday.Size = new System.Drawing.Size(50, 20);
            this.calMaximumMinuteSunday.TabIndex = 4;
            // 
            // labelControl2
            // 
            this.labelControl2.Location = new System.Drawing.Point(316, 7);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new System.Drawing.Size(67, 13);
            this.labelControl2.TabIndex = 5;
            this.labelControl2.Text = "Số phút tối đa";
            // 
            // teBeginTimeSunday
            // 
            this.teBeginTimeSunday.EditValue = new System.DateTime(2011, 7, 30, 0, 0, 0, 0);
            this.teBeginTimeSunday.Location = new System.Drawing.Point(68, 4);
            this.teBeginTimeSunday.Name = "teBeginTimeSunday";
            this.teBeginTimeSunday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.teBeginTimeSunday.Properties.Mask.EditMask = "HH:mm tt";
            this.teBeginTimeSunday.Size = new System.Drawing.Size(70, 20);
            this.teBeginTimeSunday.TabIndex = 8;
            // 
            // labelControl4
            // 
            this.labelControl4.AllowHtmlString = true;
            this.labelControl4.Location = new System.Drawing.Point(3, 7);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new System.Drawing.Size(55, 13);
            this.labelControl4.TabIndex = 9;
            this.labelControl4.Text = "Giờ bắt đầu";
            // 
            // calMinimumMinuteSunday
            // 
            this.calMinimumMinuteSunday.Location = new System.Drawing.Point(245, 4);
            this.calMinimumMinuteSunday.Name = "calMinimumMinuteSunday";
            this.calMinimumMinuteSunday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calMinimumMinuteSunday.Size = new System.Drawing.Size(50, 20);
            this.calMinimumMinuteSunday.TabIndex = 13;
            // 
            // pnOvertimeSaturday
            // 
            this.pnOvertimeSaturday.Controls.Add(this.labelControl13);
            this.pnOvertimeSaturday.Controls.Add(this.cboOvertimeSaturdayType);
            this.pnOvertimeSaturday.Controls.Add(this.pnSubOvertimeSaturday);
            this.pnOvertimeSaturday.Location = new System.Drawing.Point(8, 53);
            this.pnOvertimeSaturday.Name = "pnOvertimeSaturday";
            this.pnOvertimeSaturday.Size = new System.Drawing.Size(456, 62);
            this.pnOvertimeSaturday.TabIndex = 27;
            // 
            // labelControl13
            // 
            this.labelControl13.AllowHtmlString = true;
            this.labelControl13.Location = new System.Drawing.Point(7, 4);
            this.labelControl13.Name = "labelControl13";
            this.labelControl13.Size = new System.Drawing.Size(81, 13);
            this.labelControl13.TabIndex = 23;
            this.labelControl13.Text = "Hình thức duyệt:";
            // 
            // cboOvertimeSaturdayType
            // 
            this.cboOvertimeSaturdayType.Location = new System.Drawing.Point(96, 1);
            this.cboOvertimeSaturdayType.Name = "cboOvertimeSaturdayType";
            this.cboOvertimeSaturdayType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.cboOvertimeSaturdayType.Properties.Items.AddRange(new object[] {
            "Không quy định cụ thể thời gian tăng ca",
            "Tuân theo quy định bên dưới"});
            this.cboOvertimeSaturdayType.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            this.cboOvertimeSaturdayType.Size = new System.Drawing.Size(346, 20);
            this.cboOvertimeSaturdayType.TabIndex = 22;
            this.cboOvertimeSaturdayType.SelectedIndexChanged += new System.EventHandler(this.cboOvertimeSaturdayType_SelectedIndexChanged);
            // 
            // pnSubOvertimeSaturday
            // 
            this.pnSubOvertimeSaturday.Controls.Add(this.labelControl3);
            this.pnSubOvertimeSaturday.Controls.Add(this.calMaximumMinuteSaturday);
            this.pnSubOvertimeSaturday.Controls.Add(this.labelControl1);
            this.pnSubOvertimeSaturday.Controls.Add(this.teBeginTimeSaturday);
            this.pnSubOvertimeSaturday.Controls.Add(this.calMinimumMinuteSaturday);
            this.pnSubOvertimeSaturday.Controls.Add(this.labelControl8);
            this.pnSubOvertimeSaturday.Location = new System.Drawing.Point(4, 27);
            this.pnSubOvertimeSaturday.Name = "pnSubOvertimeSaturday";
            this.pnSubOvertimeSaturday.Size = new System.Drawing.Size(439, 28);
            this.pnSubOvertimeSaturday.TabIndex = 24;
            // 
            // labelControl3
            // 
            this.labelControl3.AllowHtmlString = true;
            this.labelControl3.Location = new System.Drawing.Point(3, 7);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new System.Drawing.Size(55, 13);
            this.labelControl3.TabIndex = 7;
            this.labelControl3.Text = "Giờ bắt đầu";
            // 
            // calMaximumMinuteSaturday
            // 
            this.calMaximumMinuteSaturday.Location = new System.Drawing.Point(388, 4);
            this.calMaximumMinuteSaturday.Name = "calMaximumMinuteSaturday";
            this.calMaximumMinuteSaturday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calMaximumMinuteSaturday.Size = new System.Drawing.Size(50, 20);
            this.calMaximumMinuteSaturday.TabIndex = 2;
            // 
            // labelControl1
            // 
            this.labelControl1.Location = new System.Drawing.Point(316, 7);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new System.Drawing.Size(67, 13);
            this.labelControl1.TabIndex = 3;
            this.labelControl1.Text = "Số phút tối đa";
            // 
            // teBeginTimeSaturday
            // 
            this.teBeginTimeSaturday.EditValue = new System.DateTime(2011, 7, 30, 0, 0, 0, 0);
            this.teBeginTimeSaturday.Location = new System.Drawing.Point(68, 4);
            this.teBeginTimeSaturday.Name = "teBeginTimeSaturday";
            this.teBeginTimeSaturday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.teBeginTimeSaturday.Properties.Mask.EditMask = "HH:mm tt";
            this.teBeginTimeSaturday.Size = new System.Drawing.Size(71, 20);
            this.teBeginTimeSaturday.TabIndex = 10;
            // 
            // calMinimumMinuteSaturday
            // 
            this.calMinimumMinuteSaturday.Location = new System.Drawing.Point(245, 4);
            this.calMinimumMinuteSaturday.Name = "calMinimumMinuteSaturday";
            this.calMinimumMinuteSaturday.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calMinimumMinuteSaturday.Size = new System.Drawing.Size(50, 20);
            this.calMinimumMinuteSaturday.TabIndex = 11;
            // 
            // labelControl8
            // 
            this.labelControl8.Location = new System.Drawing.Point(161, 7);
            this.labelControl8.Name = "labelControl8";
            this.labelControl8.Size = new System.Drawing.Size(79, 13);
            this.labelControl8.TabIndex = 12;
            this.labelControl8.Text = "Số phút tối thiểu";
            // 
            // cheIsOvertimeHoliday
            // 
            this.cheIsOvertimeHoliday.Location = new System.Drawing.Point(14, 234);
            this.cheIsOvertimeHoliday.Name = "cheIsOvertimeHoliday";
            this.cheIsOvertimeHoliday.Properties.Caption = "Đi làm ngày lễ tính là tăng ca";
            this.cheIsOvertimeHoliday.Size = new System.Drawing.Size(180, 19);
            this.cheIsOvertimeHoliday.TabIndex = 15;
            this.cheIsOvertimeHoliday.CheckedChanged += new System.EventHandler(this.cheIsOvertimeHoliday_CheckedChanged);
            // 
            // cheIsOvertimeSaturday
            // 
            this.cheIsOvertimeSaturday.Location = new System.Drawing.Point(12, 27);
            this.cheIsOvertimeSaturday.Name = "cheIsOvertimeSaturday";
            this.cheIsOvertimeSaturday.Properties.Caption = "Đi làm thứ 7 tính là tăng ca";
            this.cheIsOvertimeSaturday.Size = new System.Drawing.Size(180, 19);
            this.cheIsOvertimeSaturday.TabIndex = 1;
            this.cheIsOvertimeSaturday.CheckedChanged += new System.EventHandler(this.cheIsOvertimeSaturday_CheckedChanged);
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.labelControl7);
            this.groupBox2.Controls.Add(this.teEndTimeNight);
            this.groupBox2.Controls.Add(this.labelControl6);
            this.groupBox2.Controls.Add(this.teBeginTimeNight);
            this.groupBox2.Controls.Add(this.labelControl5);
            this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox2.Location = new System.Drawing.Point(0, 341);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(528, 97);
            this.groupBox2.TabIndex = 2;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Giờ ca đêm";
            this.groupBox2.Enter += new System.EventHandler(this.groupBox2_Enter);
            // 
            // labelControl7
            // 
            this.labelControl7.Appearance.ForeColor = System.Drawing.Color.DimGray;
            this.labelControl7.Location = new System.Drawing.Point(16, 58);
            this.labelControl7.Name = "labelControl7";
            this.labelControl7.Size = new System.Drawing.Size(401, 13);
            this.labelControl7.TabIndex = 16;
            this.labelControl7.Text = "Ví dụ: từ 21:00 tối đến 5:00 sáng hôm sau hoặc 22:00 tối đến 6:00 sáng hôm sau,.." +
    "";
            // 
            // teEndTimeNight
            // 
            this.teEndTimeNight.EditValue = new System.DateTime(2011, 7, 30, 0, 0, 0, 0);
            this.teEndTimeNight.Location = new System.Drawing.Point(336, 28);
            this.teEndTimeNight.Name = "teEndTimeNight";
            this.teEndTimeNight.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.teEndTimeNight.Properties.Mask.EditMask = "HH:mm tt";
            this.teEndTimeNight.Size = new System.Drawing.Size(71, 20);
            this.teEndTimeNight.TabIndex = 14;
            // 
            // labelControl6
            // 
            this.labelControl6.AllowHtmlString = true;
            this.labelControl6.Location = new System.Drawing.Point(183, 30);
            this.labelControl6.Name = "labelControl6";
            this.labelControl6.Size = new System.Drawing.Size(147, 13);
            this.labelControl6.TabIndex = 13;
            this.labelControl6.Text = "Giờ kết thúc của ngày hôm sau";
            // 
            // teBeginTimeNight
            // 
            this.teBeginTimeNight.EditValue = new System.DateTime(2011, 7, 30, 0, 0, 0, 0);
            this.teBeginTimeNight.Location = new System.Drawing.Point(81, 28);
            this.teBeginTimeNight.Name = "teBeginTimeNight";
            this.teBeginTimeNight.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton()});
            this.teBeginTimeNight.Properties.Mask.EditMask = "HH:mm tt";
            this.teBeginTimeNight.Size = new System.Drawing.Size(71, 20);
            this.teBeginTimeNight.TabIndex = 12;
            // 
            // labelControl5
            // 
            this.labelControl5.AllowHtmlString = true;
            this.labelControl5.Location = new System.Drawing.Point(16, 31);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new System.Drawing.Size(55, 13);
            this.labelControl5.TabIndex = 11;
            this.labelControl5.Text = "Giờ bắt đầu";
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.labelControl21);
            this.groupBox3.Controls.Add(this.labelControl19);
            this.groupBox3.Controls.Add(this.labelControl18);
            this.groupBox3.Controls.Add(this.labelControl17);
            this.groupBox3.Controls.Add(this.labelControl16);
            this.groupBox3.Controls.Add(this.calNumberHourStandard);
            this.groupBox3.Controls.Add(this.calNumberDayStandard);
            this.groupBox3.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox3.Location = new System.Drawing.Point(0, 438);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(528, 137);
            this.groupBox3.TabIndex = 3;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Ngày/giờ công chuẩn trong 1 tháng làm việc";
            this.groupBox3.Enter += new System.EventHandler(this.groupBox3_Enter);
            // 
            // labelControl21
            // 
            this.labelControl21.Appearance.ForeColor = System.Drawing.Color.DimGray;
            this.labelControl21.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
            this.labelControl21.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None;
            this.labelControl21.Location = new System.Drawing.Point(16, 27);
            this.labelControl21.Name = "labelControl21";
            this.labelControl21.Size = new System.Drawing.Size(434, 27);
            this.labelControl21.TabIndex = 16;
            this.labelControl21.Text = "Trong trường hợp không xếp ca cho nhân viên thì chương trình sẽ lấy ngày và giờ c" +
    "ông chuẩn dưới đây để tính lương giờ (hoặc ngày) cho nhân viên.";
            // 
            // labelControl19
            // 
            this.labelControl19.Appearance.ForeColor = System.Drawing.Color.DimGray;
            this.labelControl19.Location = new System.Drawing.Point(242, 103);
            this.labelControl19.Name = "labelControl19";
            this.labelControl19.Size = new System.Drawing.Size(164, 13);
            this.labelControl19.TabIndex = 17;
            this.labelControl19.Text = "Ví dụ: 208 giờ công chuẩn/1 tháng";
            // 
            // labelControl18
            // 
            this.labelControl18.Appearance.ForeColor = System.Drawing.Color.DimGray;
            this.labelControl18.Location = new System.Drawing.Point(242, 75);
            this.labelControl18.Name = "labelControl18";
            this.labelControl18.Size = new System.Drawing.Size(168, 13);
            this.labelControl18.TabIndex = 17;
            this.labelControl18.Text = "Ví dụ: 26 ngày công chuẩn/1 tháng";
            // 
            // labelControl17
            // 
            this.labelControl17.Location = new System.Drawing.Point(16, 101);
            this.labelControl17.Name = "labelControl17";
            this.labelControl17.Size = new System.Drawing.Size(132, 13);
            this.labelControl17.TabIndex = 0;
            this.labelControl17.Text = "Số giờ công chuẩn/1 tháng:";
            // 
            // labelControl16
            // 
            this.labelControl16.Location = new System.Drawing.Point(16, 73);
            this.labelControl16.Name = "labelControl16";
            this.labelControl16.Size = new System.Drawing.Size(142, 13);
            this.labelControl16.TabIndex = 0;
            this.labelControl16.Text = "Số ngày công chuẩn/1 tháng:";
            // 
            // calNumberHourStandard
            // 
            this.calNumberHourStandard.EditValue = new decimal(new int[] {
            26,
            0,
            0,
            0});
            this.calNumberHourStandard.Location = new System.Drawing.Point(169, 99);
            this.calNumberHourStandard.Name = "calNumberHourStandard";
            this.calNumberHourStandard.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calNumberHourStandard.Size = new System.Drawing.Size(65, 20);
            this.calNumberHourStandard.TabIndex = 11;
            // 
            // calNumberDayStandard
            // 
            this.calNumberDayStandard.EditValue = new decimal(new int[] {
            26,
            0,
            0,
            0});
            this.calNumberDayStandard.Location = new System.Drawing.Point(169, 71);
            this.calNumberDayStandard.Name = "calNumberDayStandard";
            this.calNumberDayStandard.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.calNumberDayStandard.Size = new System.Drawing.Size(65, 20);
            this.calNumberDayStandard.TabIndex = 11;
            // 
            // xucTimekeeperFormula
            // 
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.Name = "xucTimekeeperFormula";
            this.Padding = new System.Windows.Forms.Padding(0, 0, 0, 8);
            this.Size = new System.Drawing.Size(528, 636);
            ((System.ComponentModel.ISupportInitialize)(this.cheIsOvertimeSunday.Properties)).EndInit();
            this.groupBox1.ResumeLayout(false);
            this.pnOvertimeHoliday.ResumeLayout(false);
            this.pnOvertimeHoliday.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cboOvertimeHolidayType.Properties)).EndInit();
            this.pnSubOvertimeHoliday.ResumeLayout(false);
            this.pnSubOvertimeHoliday.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calMaximumMinuteHoliday.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.teBeginTimeHoliday.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.calMinimumMinuteHoliday.Properties)).EndInit();
            this.pnOvertimeSunday.ResumeLayout(false);
            this.pnOvertimeSunday.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cboOvertimeSundayType.Properties)).EndInit();
            this.pnSubOvertimeSunday.ResumeLayout(false);
            this.pnSubOvertimeSunday.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calMaximumMinuteSunday.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.teBeginTimeSunday.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.calMinimumMinuteSunday.Properties)).EndInit();
            this.pnOvertimeSaturday.ResumeLayout(false);
            this.pnOvertimeSaturday.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cboOvertimeSaturdayType.Properties)).EndInit();
            this.pnSubOvertimeSaturday.ResumeLayout(false);
            this.pnSubOvertimeSaturday.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calMaximumMinuteSaturday.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.teBeginTimeSaturday.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.calMinimumMinuteSaturday.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.cheIsOvertimeHoliday.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.cheIsOvertimeSaturday.Properties)).EndInit();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.teEndTimeNight.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.teBeginTimeNight.Properties)).EndInit();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.calNumberHourStandard.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.calNumberDayStandard.Properties)).EndInit();
            this.ResumeLayout(false);

        }

        public void Save()
        {
            string text = new DIC_TIMEKEEPER_FORMULA { 
                IsOvertimeSaturday = this.cheIsOvertimeSaturday.Checked, OvertimeSaturdayType = this.cboOvertimeSaturdayType.SelectedIndex, BeginTimeSaturday = Convert.ToDateTime(this.teBeginTimeSaturday.EditValue.ToString()), MinimumMinuteSaturday = int.Parse(this.calMinimumMinuteSaturday.EditValue.ToString()), MaximumMinuteSaturday = int.Parse(this.calMaximumMinuteSaturday.EditValue.ToString()), IsOvertimeSunday = this.cheIsOvertimeSunday.Checked, OvertimeSundayType = this.cboOvertimeSundayType.SelectedIndex, BeginTimeSunday = Convert.ToDateTime(this.teBeginTimeSunday.EditValue.ToString()), MinimumMinuteSunday = int.Parse(this.calMinimumMinuteSunday.EditValue.ToString()), MaximumMinuteSunday = int.Parse(this.calMaximumMinuteSunday.EditValue.ToString()), IsOvertimeHoliday = this.cheIsOvertimeHoliday.Checked, OvertimeHolidayType = this.cboOvertimeHolidayType.SelectedIndex, BeginTimeHoliday = Convert.ToDateTime(this.teBeginTimeHoliday.EditValue.ToString()), MinimumMinuteHoliday = int.Parse(this.calMinimumMinuteHoliday.EditValue.ToString()), MaximumMinuteHoliday = int.Parse(this.calMaximumMinuteHoliday.EditValue.ToString()), BeginTimeNight = Convert.ToDateTime(this.teBeginTimeNight.EditValue.ToString()), 
                EndTimeNight = Convert.ToDateTime(this.teEndTimeNight.EditValue.ToString()), NumberDayStandard = Convert.ToDouble(this.calNumberDayStandard.EditValue.ToString()), NumberHourStandard = Convert.ToDouble(this.calNumberHourStandard.EditValue.ToString())
             }.Update();
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }

        private void groupBox2_Enter(object sender, EventArgs e)
        {

        }

        private void groupBox3_Enter(object sender, EventArgs e)
        {

        }
    }
}

